mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-19 05:02:40 +08:00
Merge branch 'next' into tech/introduce-preview-api
This commit is contained in:
commit
5151554b4d
@ -88,14 +88,14 @@ This replaces the input with a radio group for a more intuitive experience.
|
||||
|
||||
## Custom control type matchers
|
||||
|
||||
For a few types, Controls will automatically infer them by using [regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). You can change the matchers for a regex that suits you better.
|
||||
For a few types, Controls can automatically be inferred with [regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). If you've used the Storybook CLI to setup your project it should have automatically created the following defaults in `.storybook/preview.js`:
|
||||
|
||||
| Data type | Default regex | Description |
|
||||
| :-------: | :-----------------------: | :-------------------------------------------------------: |
|
||||
| **color** | `/(background\|color)$/i` | Will display a color picker UI for the args that match it |
|
||||
| **color** | `/(background|color)$/i` | Will display a color picker UI for the args that match it |
|
||||
| **date** | `/Date$/` | Will display a date picker UI for the args that match it |
|
||||
|
||||
To do so, use the `matchers` property in the `controls` parameter:
|
||||
If you haven't used the CLI to setup the configuration, or if you want to define your own patterns, use the `matchers` property in the `controls` parameter:
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user