@material-ui/core#InputAdornmentProps TypeScript Examples
The following examples show how to use
@material-ui/core#InputAdornmentProps.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.tsx From frontegg-react with MIT License | 6 votes |
appendAdornment = (
props: Partial<MaterialTextFieldProps> | undefined,
at: keyof MaterialInputProps,
iconAction: InputProps['iconAction'],
icon: InputProps['prefixIcon'] | InputProps['suffixIcon']
) => {
const position: InputAdornmentProps['position'] = at === 'startAdornment' ? 'start' : 'end';
return {
...props,
InputProps: {
[at]: (
<InputAdornment onClick={iconAction} position={position}>
{iconAction ? <IconButton>{icon}</IconButton> : icon}
</InputAdornment>
),
},
};
}