MCPcopy Create free account
hub / github.com/better-auth/examples / SelectItem

Function SelectItem

astro-example/src/components/ui/select.tsx:91–127  ·  view source on GitHub ↗
(
	props: PolymorphicProps<T, selectItemProps<T>>,
)

Source from the content-addressed store, hash-verified

89>;
90
91export const SelectItem = <T extends ValidComponent = "li">(
92 props: PolymorphicProps<T, selectItemProps<T>>,
93) => {
94 const [local, rest] = splitProps(props as selectItemProps, [
95 "class",
96 "children",
97 ]);
98
99 return (
100 <SelectPrimitive.Item
101 class={cn(
102 "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
103 local.class,
104 )}
105 {...rest}
106 >
107 <SelectPrimitive.ItemIndicator class="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
108 <svg
109 xmlns="http://www.w3.org/2000/svg"
110 class="h-4 w-4"
111 viewBox="0 0 24 24"
112 >
113 <path
114 fill="none"
115 stroke="currentColor"
116 strokeLinecap="round"
117 strokeLinejoin="round"
118 strokeWidth="2"
119 d="m5 12l5 5L20 7"
120 />
121 <title>Checked</title>
122 </svg>
123 </SelectPrimitive.ItemIndicator>
124 <SelectPrimitive.ItemLabel>{local.children}</SelectPrimitive.ItemLabel>
125 </SelectPrimitive.Item>
126 );
127};

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected