Skip to content

Commit

Permalink
Merge pull request #23485 from DiamondeX/patch-1
Browse files Browse the repository at this point in the history
Update controls.md
  • Loading branch information
jonniebigodes authored Nov 24, 2023
2 parents 716bbac + 3ea45c6 commit 443f1b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/essentials/controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ This replaces the input with a radio group for a more intuitive experience.

## Custom control type matchers

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`:
Controls can automatically be inferred from arg's name with [regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp), but currently only for the color picker and date picker controls. 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 |
| Control | Default regex | Description |
| :-------: | :--------------------------------------: | :-------------------------------------------------------: |
| **color** | <code>/(background&#124;color)$/i</code> | 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 |
Expand Down

0 comments on commit 443f1b6

Please sign in to comment.