A native select component with feedback color states, size variants, and prefix/suffix customization via passThrough.
Apply semantic feedback colors to indicate validation state or context.
---
import Select from "../select.astro";
import { stack } from "@pindoba/styled-system/patterns";
const items = [
{ label: "Apple", value: "apple" },
{ label: "Banana", value: "banana" },
{ label: "Cherry", value: "cherry" },
];
---
<div class={stack({ gap: "md", direction: "column" })}>
<Select feedback="neutral" items={items} />
<Select feedback="primary" items={items} />
<Select feedback="success" items={items} />
<Select feedback="danger" items={items} />
<Select feedback="warning" items={items} />
</div>---
import Select from "../select.astro";
import { stack } from "@pindoba/styled-system/patterns";
const items = [
{ label: "Apple", value: "apple" },
{ label: "Banana", value: "banana" },
{ label: "Cherry", value: "cherry" },
];
---
<div class={stack({ gap: "md", direction: "column" })}>
<Select size="sm" items={items} />
<Select size="md" items={items} />
<Select size="lg" items={items} />
</div>The passThrough prop provides escape hatches for each slot: style accepts a Panda CSS SystemStyleObject and props forwards arbitrary HTML attributes.
---
import Select from "../select.astro";
import { stack } from "@pindoba/styled-system/patterns";
const items = [
{ label: "Apple", value: "apple" },
{ label: "Banana", value: "banana" },
{ label: "Cherry", value: "cherry" },
];
---
<div class={stack({ gap: "md", direction: "column" })}>
<Select
items={items}
passThrough={{
root: { style: { borderRadius: "full" } },
}}
/>
<Select
items={items}
passThrough={{
select: { style: { fontStyle: "italic" } },
}}
/>
</div>| Prop | |
|---|---|
feedback | feedback Semantic feedback color scheme. neutral: Default. primary: Primary color. success: Green. danger: Red. warning: Orange. Type Default Required |
size | size Size variant. sm: Small. md: Default. lg: Large. Type Default Required |
background | background Background fill for the select wrapper. Type Default Required |
items | items Array of options to display in the select. Type Default Required |
passThrough | passThrough Custom styling and props for each slot of the select. Type Default Required |
...rest | ...rest Standard HTML select attributes passed to the inner select element. Type Default Required |