Using Grommet for HPE?See MaskedInput examples and guidance.
An optional icon to show. This could be used to provide an indication of what kind of input is expected, like an email icon, or what the input will be used for, like a search icon.
element
<Icon />
Describes the structure of the mask.
array
If a regexp is provided, it should allow both the final full string element as well as partial strings as the user types characters one by one. When using regexp to match number values make sure that the option values are numbers as well. If the
options
prop is specified restrictToOptions
can be set to false to allow input that differs from the items in options
.[ { length: number | [number], fixed: "string", options: [string] | [number], regexp: {}, placeholder: "string", restrictToOptions: true } ]
Whether an icon should be reversed so that the icon is at the end of the input.
boolean
true
false
The size of the text.
string
"xsmall"
"small"
"medium"
"large"
"xlarge"
"xxlarge"
"2xl"
"3xl"
"4xl"
"5xl"
"6xl"
"string"
At its core, the MaskedInput component is a regular <input> element. Thus, both DOM and React properties, methods, and events are accessible. To read up on all of the possible DOM attributes and types available for input elements, check out this MDN Web Documents page. To learn more about DOM events and methods, you can read more on the MDN Web Events documentation page.
Also, feel free to read about the types of React events available, or see how DOM attributes change in React. Working in tandem with Styled Components, you also have access to the as property.
The background style when hovering.
string
A hex, name, or rgb value.
"active"
object
{ color: "active", opacity: "medium" }
The text color when hovering.
string
A hex, name, or rgb value.
"black"
object
An object with a color for dark and light modes.
{ dark: "white", light: "black" }
Any additional style for MaskedInput.
string
Any CSS.
css`color: 'blue'`
function
(props) => {}
Any additional style for the container surrounding the input and, if present, icon.
string
Any CSS.
css`color: 'blue'`
function
(props) => {}
The border color of the component when in focus.
string
A hex, name, or rgb value.
"focus"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The outline color around the component when in focus.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The shadow color around the component when in focus.
string
"focus"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The font-weight of the text. This value will only be applied if global.input.weight is undefined.
string
"bold"
number
600
This value has been deprecated and replaced by global.input.font.weight.
string
"bold"
number
300
The padding of the text.
string
"12px"
object
An object specifying padding for different sides of the component.
{ top: "string", bottom: "string", left: "string", right: "string", horizontal: "string", vertical: "string" }