diff --git a/docs/src/pages/components/TextInput.svx b/docs/src/pages/components/TextInput.svx index f3d047de..a9c33cba 100644 --- a/docs/src/pages/components/TextInput.svx +++ b/docs/src/pages/components/TextInput.svx @@ -7,54 +7,82 @@ components: ["TextInput", "TextInputSkeleton"] import Preview from "../../components/Preview.svelte"; +`TextInput` provides a single-line text input field with support for various states, sizes, and accessibility features. It's ideal for short text input like usernames, search terms, or form fields. + ## Default +Create a basic text input with a label and placeholder text. + ## With helper text +Add helper text below the input to provide additional context or instructions. + ## Hidden label +Visually hide the label while maintaining accessibility by setting `hideLabel` to `true`. + ## Light variant +Use the light variant for light-themed backgrounds by setting `light` to `true`. + ## Inline variant +Use the inline variant to display the label and input on the same line by setting `inline` to `true`. + ## Read-only variant +Display a non-editable value by setting `readonly` to `true`. + ## Extra-large size +Use the extra-large size for more prominent inputs by setting `size` to `"xl"`. + ## Small size +Use the small size for more compact inputs by setting `size` to `"sm"`. + ## Invalid state +Indicate an invalid state with an error message by setting `invalid` to `true` and providing `invalidText`. + ## Warning state +Indicate a warning state with a message by setting `warn` to `true` and providing `warnText`. + ## Disabled state +Disable the input to prevent user interaction by setting `disabled` to `true`. + ## Skeleton +Show a loading state with the default skeleton variant. + ## Skeleton without label +Show a loading state without a label by setting `hideLabel` to `true`. + \ No newline at end of file