Skip to content
course-kit
Menu

<download-button>

A download link with an icon. The label is the slot. With no file there is no link: a download button that points nowhere is not shown.

Building blocks

Examples

Default

Color scheme
Width

Open on its own

Source
<download-button @url="/resources/starter.zip">Download the starter files</download-button>

Long label

Color scheme
Width

Open on its own

Source
<download-button @url="#">Download the complete course packet, with every slide deck, worksheet and starter file</download-button>

Called with page data

Color scheme
Width

Open on its own

Source
<download-button @url="/resources/starter.zip">Download the starter files</download-button>

Props

Write them with the @ prefix, and :@ for an expression. A prop in square brackets is optional.

Name Type Description
url string the file to download. Only a string counts: a prop that is not given can resolve to Eleventy's url filter, which would print as the function's source

Color tokens

The tokens this component's styles read. Set one in _data/theme.json to change it everywhere.

Pick a color to try it in every example above.

Token Colors Try a color
--color-accent Brand color: fills, buttons, rules, the masthead wash
--color-accent-text Brand color for type, dark enough to read
--color-border Lines, rules and borders
--color-text Body text