LabelMenuButton
LabelMenuButton is a button that displays both a label and the selected value, used as the trigger for Select.
Want to skip the docs? Try our MCP Server
#
Documentation
#
#
Usage
#
Pass the field name to the label prop and use LabelMenuButton with SelectTrigger asChild. The selected value is shown beneath the label.
"use client";
import {
LabelMenuButton,
Select,
SelectContent,
SelectTrigger,
} from "@optiaxiom/react";
export function App() {
return (
<Select
options={[
{ label: "No priority", value: "" },
{ label: "Urgent", value: "Urgent" },
{ label: "High", value: "High" },
{ label: "Medium", value: "Medium" },
{ label: "Low", value: "Low" },
]}
>
<SelectTrigger asChild w="224">
<LabelMenuButton label="Priority" />
</SelectTrigger>
<SelectContent />
</Select>
);
}#
Related
#
Select
Select a value from a list of options inside a dropdown menu.
#
Props
#
#
LabelMenuButton
#
Supports all Box props in addition to its own. Renders a <div> element.
Prop |
|---|
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read the Composition guide for more details.
|
children
|
className
|
disabledWhether the button is disabled.
|
label*The label of the button.
|
loadingWhether to show loading spinner inside the button.
|
squareWhether button should have square shape.
|
typeThe default behavior of the button.
|
#
Changelog
#
#
1.1.2
#
- Added component