You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/circuit-ui/components/ColorInput/ColorInput.mdx
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,28 +5,29 @@ import * as Stories from './ColorInput.stories';
5
5
6
6
# ColorInput
7
7
8
-
## Use cases and API
9
8
<Statusvariant="stable" />
10
9
11
10
The ColorInput component enables users to type a color in a text field or select it using the browser native color picker.
12
11
13
-
Use the ColorInput component to allow users to input a color value to personalize content such as UI themes, profile settings or other customizable experiences.
12
+
<Storyof={Stories.Base} />
13
+
<Props />
14
14
15
+
## Usage
16
+
17
+
Use the ColorInput component to allow users to input a color value to personalize content such as UI themes, profile settings or other customizable experiences.
15
18
16
19
The component only supports seven-character string representations of colors in hexadecimal format. Shorthand Hex values like `#fff` will not be normalized to `#ffffff` and values with alpha channel like `##ffffff50` will not be accepted.
20
+
17
21
- Accepted: `#aabbcc`, `#AABBCC`
18
22
- Not accepted: `#abc`, `#aabbccaa`, `#ABC`, `#AABBCCAA`
19
23
20
-
<Storyof={Stories.Base} />
21
-
22
-
<Props />
23
-
24
24
## Validations
25
25
26
26
Use the `validationHint` prop to communication information about the state of the ColorInput component, along with one of the following validation props:
27
+
27
28
- stand-alone: The user is informed of the expected response.
28
-
-`showWarning`: The user is warned that the value is not recommended but still valid.
29
-
-`showError`: The user is alerted that the value is invalid.
29
+
-`invalid`: The user is alerted that the value is invalid.
30
+
-`hasWarning`: The user is warned that the value is not recommended but still valid.
30
31
-`showValid`: The user is reassured that the value is valid. Use sparingly.
31
32
32
33
<Storyof={Stories.Validations} />
@@ -47,4 +48,5 @@ The read-only state is applied to the text input field of the ColorInput compone
47
48
## Disabled
48
49
49
50
Disabled form fields can be confusing to users, so use them with caution. Use a disabled color input only if you need to communicate to the user that an option that existed before is not available for choosing now. Consider not displaying the field at all or add an explanation why the field is disabled.
0 commit comments