Using Grommet for HPE?See FileInput examples and guidance.
function
({ onConfirm, onCancel }) => ( <Layer onClickOutside={onCancel} onEsc={onCancel}> <Box> Are you sure you want to delete this file? <Box direction="row" gap="small"> <Button label="Cancel" onClick={onCancel} /> <Button label="Delete file" onClick={onConfirm} /> </Box> </Box> </Layer> )
object
{ browse: "browse", dropPrompt: "Drop file here or", dropPromptMultiple: "Drop files here or", files: "files", remove: "remove", removeAll: "remove all", maxFile: "Attach a maximum of {max} files only." }
boolean
true
false
object
{ aggregateThreshold: number, max: number }
function
The function will be passed two arguments: the event and an object with key 'files'. The file(s) can be found in event.target.files or by deconstructing files from the second argument. For example: (event, {files}) => {}.
({ target: { files } }) => {...}
At its core, the FileInput 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.
string
"bold"
number
600
string
"bold"
number
300
string
"12px"
object
{ top: "string", bottom: "string", left: "string", right: "string", horizontal: "string", vertical: "string" }
string
css`color: 'blue'`
function
(props) => {}
string
"neutral-1"
"url(//my.com/assets/img.png)"
object
{ color: "neutral-1", dark: true, image: "url(//my.com/assets/img.png)" position: "bottom", opacity: true, repeat: "no-repeat", size: "cover", light: "string" }
"weak"
"medium"
"strong"
boolean
number
any CSS for background-position
"no-repeat"
"repeat"
"string"
"cover"
"contain"
"string"
string
"horizontal"
"vertical"
"top"
"bottom"
"right"
"left"
object
{ side: "all", size: "small", style: "dashed" }
{ color: "string" | { dark: "string", light: "string" }, error: { color: "string" | { dark: "string", light: "string" } }, position: "string", side: "string", size: "string", style: "string" }
string
"neutral-1"
"url(//my.com/assets/img.png)"
object
{ color: "neutral-1", dark: true, image: "url(//my.com/assets/img.png)" position: "bottom", opacity: true, repeat: "no-repeat", size: "cover", light: "string" }
"weak"
"medium"
"strong"
boolean
number
any CSS for background-position
"no-repeat"
"repeat"
"string"
"cover"
"contain"
"string"
string
"horizontal"
"vertical"
"top"
"bottom"
"right"
"left"
object
{ color: "string" | { dark: "string", light: "string" }, error: { color: "string" | { dark: "string", light: "string" } }, position: "string", side: "string", size: "string", style: "string" }
string
css`color: 'blue'`
function
(props) => {}
string
css`color: 'blue'`
function
(props) => {}
string
"neutral-1"
"url(//my.com/assets/img.png)"
object
{ color: "neutral-1", dark: true, image: "url(//my.com/assets/img.png)" position: "bottom", opacity: true, repeat: "no-repeat", size: "cover", light: "string" }
"weak"
"medium"
"strong"
boolean
number
any CSS for background-position
"no-repeat"
"repeat"
"string"
"cover"
"contain"
"string"
string
"horizontal"
"vertical"
"top"
"bottom"
"right"
"left"
object
{ color: "brand" }
{ color: "string" | { dark: "string", light: "string" }, error: { color: "string" | { dark: "string", light: "string" } }, position: "string", side: "string", size: "string", style: "string" }
string
css`color: 'blue'`
function
(props) => {}
React.Element
<FormClose />
object
{ margin: "small" }
string
"none"
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"any CSS size"
object
{ vertical: "...", horizontal: "...", top: "...", bottom: "...", left: "...", right: "...", start: "...", end: "..." }