import { ComponentLinks, InteractiveCodeblock, PropsTable, Codeblock, } from "@/components/index";
The Select component with collection of predefined options is used to pick a value.
import {
Select,
SelectBase,
SelectPrefix,
SelectSuffix,
useSelectProps,
useSelectState,
SelectWrapper,
} from "@adaptui/react-tailwind";<Nextra.Callout> A complex component that supports customization as per the composition guide. </Nextra.Callout>
<InteractiveCodeblock children={({ spreadProps }) => ` <Select ${spreadProps}>
Select anyone Dog Cat Hamster Parrot Spider Goldfish `} booleanProps={["disabled", "invalid", "loading"]} themeProps={{ variant: "select.variant", size: "select.size" }} />Variants can be set using the variant prop. The default variant is outline.
The available variants are: outline subtle underline & ghost
<Codeblock live code={`
Sizes can be set using the size prop. The default size is md. The available
sizes are: sm md lg xl
<Codeblock live code={`
Comes only with prefix prop to append any content inside the Select. Also you
can change the default suffix component aswell.
<Codeblock live code={`
<PropsTable
data={[
{ name: "size", themeKey: "select.size", default: "md" },
{ name: "variant", themeKey: "select.variant", default: "outline" },
{
name: "disabled",
type: "boolean",
description: "If true, the Select will be disabled.",
default: "false",
},
{
name: "invalid",
type: "boolean",
description: "True, if the value of the select is invalid.",
default: "false",
},
{
name: "loading",
type: "boolean",
description: "True, if the select is loading.",
default: "false",
},
{
name: "prefix",
type: "React.ReactNode",
description: "Prefix for the Select",
},
{
name: "suffix",
type: "React.ReactNode",
description: "Suffix for the Select",
},
{
name: "spinner",
type: "React.ReactNode",
description: "Spinner component to display when loading.",
},
]} />