Skip to content

Commit

Permalink
feat: added example to readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Kharitonov committed Jan 30, 2024
1 parent c8a947f commit d40aff7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/components/Select/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,25 @@ const MyComponent = () => {

<!--/GITHUB_BLOCK-->

### Error

The state of the `Select` in which you want to indicate incorrect user input. To change `Select` appearance, use the `validationState` property with the `"invalid"` value. An optional message text can be added via the `errorMessage` property. By default, message text is rendered outside the component.
This behaviour can be changed with the `errorPlacement` property.

<!--LANDING_BLOCK
<ExampleBlock
code={`
<Select placeholder="Placeholder" errorMessage="Error message" validationState="invalid" />
<Select placeholder="Placeholder" errorPlacement="inside" errorMessage="Error message" validationState="invalid" />
`}
>
<UIKit.Select placeholder="Placeholder" errorMessage="Error message" validationState="invalid" />
<UIKit.Select placeholder="Placeholder" errorPlacement="inside" errorMessage="Error message" validationState="invalid" />
</ExampleBlock>
LANDING_BLOCK-->

<!--GITHUB_BLOCK-->

## Properties

| Name | Description | Type | Default |
Expand Down Expand Up @@ -1016,3 +1035,6 @@ const MyComponent = () => {
| view | Control view | `string` | `'normal'` |
| [virtualizationThreshold](#virtualized-list) | The threshold of the options count after which virtualization is enabled | `number` | `50` |
| [width](#control-width) | Control width | `string \| number` | `undefined` |
| errorMessage | Error text | `string` | |
| errorPlacement | Error placement | `outside` `inside` | `outside` |
| validationState | Validation state | `"invalid"` | |

0 comments on commit d40aff7

Please sign in to comment.