Number field
Enter a bounded number with clear increment controls.
A textarea with @people and #channel mentions that act as single tokens, with suggestions at the caret.
npx shadcn@latest add @silicon-ui/mention-inputnpx shadcn@latest add @silicon-ui/mention-inputInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/mention-input/mention-input.tsxcomponents/silicon-ui/mention-input/mention-input.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
value | MentionValue | — |
defaultValue | MentionValue | — |
onChange | (value: MentionValue) => void | — |
peoplePeople offered after `@`. Leave it out to turn person mentions off. | MentionPerson[] | — |
channelsChannels offered after `#`. Leave it out to turn channel mentions off. | MentionChannel[] | — |
onMentionAddCalled when a suggestion becomes a mention. | (mention: Mention) => void | — |
onSubmitWith `submitOnEnter`, Enter submits and Shift+Enter adds a line. | (value: MentionValue) => void | — |
submitOnEnter | boolean | false |
placeholder | string | — |
minRows | number | 1 |
maxRowsThe field grows to this many rows, then scrolls. | number | 8 |
placementWhere suggestions open. `auto` flips above when there is no room below. | "auto" | "top" | "bottom" | "auto" |
maxSuggestions | number | 6 |
disabled | boolean | — |
name | string | — |
id | string | — |
aria-label | string | — |
aria-describedby | string | — |
className | string | — |
Also accepts the props of HTMLAttributes.