0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-02 14:24:19 +01:00
Bootstrap/site/content/docs/5.0/forms/file.md
XhmikosR 38ec7c4df7
Bump version to 5.0.0-alpha1 (#29925)
Also add v4.5.0 in versions and keep README.md pointing to v4.5.0 so that there are no broken stuff.
2020-05-13 22:36:00 +03:00

2.7 KiB

layout title description group toc
docs File browser Use our custom file inputs for consistent cross-browser styling, built-in customization, and lightweight JavaScript. forms true

{{< callout info >}} The recommended plugin to animate custom file inputs is bs-custom-file-input; it's what we use here in our docs. {{< /callout >}}

Default

The file input is the most gnarly of the bunch and requires additional JavaScript if you'd like to hook them up with functional Choose file... and selected file name text.

{{< example >}}

{{< /example >}}

Add the disabled attribute to the <input> and the custom markup will be updated to appear disabled.

{{< example >}}

{{< /example >}}

Longer placeholder text is truncated and an ellipsis is added when there's not enough space.

{{< example >}}

{{< /example >}}

We hide the default file <input> via opacity and instead style the <label>, and declare a width and height on the <input> for proper spacing for surrounding content.

Sizing

You may also choose from small and large file inputs to match our similarly sized text inputs.

{{< example >}}

{{< /example >}}