MCPcopy
hub / github.com/JedWatson/react-select / Template

Function Template

storybook/stories/ClassNamesWithTailwind.stories.tsx:33–62  ·  view source on GitHub ↗
({
  inputId = 'react-select',
  ...props
})

Source from the content-addressed store, hash-verified

31};
32
33const Template: ComponentStory<typeof Select> = ({
34 inputId = 'react-select',
35 ...props
36}) => {
37 return (
38 <EmotionCacheProvider>
39 <Field htmlFor={inputId} label="ClassNames With Tailwind">
40 <Select
41 inputId={inputId}
42 {...props}
43 classNames={{
44 control: ({ isDisabled, isFocused }) =>
45 classNames(
46 !isDisabled && isFocused && 'border-purple-800',
47 isFocused && 'shadow-[0_0_0_1px] shadow-purple-800',
48 isFocused && 'hover:border-purple-800'
49 ),
50 option: ({ isDisabled, isFocused, isSelected }) =>
51 classNames(
52 isSelected && 'bg-purple-800',
53 !isSelected && isFocused && 'bg-purple-300',
54 !isDisabled && isSelected && 'active:bg-purple-800',
55 !isDisabled && !isSelected && 'active:bg-purple-500'
56 ),
57 }}
58 />
59 </Field>
60 </EmotionCacheProvider>
61 );
62};
63
64export const ClassNamesWithTailwind = Template.bind({});
65ClassNamesWithTailwind.args = {

Callers

nothing calls this directly

Calls 1

classNamesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…