1.0.1 • Published 27 days ago

@sikt/sds-input-file v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
27 days ago

@sikt/sds-input-file

Consume

npm i -s @sikt/sds-{form,input-file}

React

import { InputFile, FileList, FileListItem } from "@sikt/sds-input-file";
import "@sikt/sds-form/dist/index.css";
import "@sikt/sds-input-file/dist/index.css";

<InputFile
  label="Upload documentation"
  aria-label="Upload documentation"
  accept=".doc,.docx"
  onChange={changeHandler}
>
  <FileList figCaption="Attatchments">
    files.map((file) => {
      <FileListItem
        fileSize={file.size}
        actionProps{{ label: `Remove ${file.name}`, onClick: handleFileClick }}
      >
        {file.name}
      </FileListItem>
    })
  </FileList>
</InputFile>

Caveats

  • "aria-label": Should be the text content of the label prop. This is used to override React Aria DropZone that sets it's own aria-label.
  • accept: Does not currently support wildcard (for example "*" or "image/*")

Stylesheets & custom markup

Import stylesheet:

@import url("@sikt/sds-form");
@import url("@sikt/sds-input-file");

Create custom markup:

<!-- N/A -->
1.0.1

27 days ago

1.0.0

2 months ago

0.2.7

3 months ago

0.2.6

3 months ago

0.2.3

8 months ago

0.2.2

8 months ago

0.2.5

4 months ago

0.2.4

5 months ago

0.2.1

8 months ago

0.2.0

9 months ago

0.1.0

9 months ago