3.0.22 • Published 8 months ago

@288-toolkit/html-elements v3.0.22

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Html-elements

npm i @288-toolkit/html-elements

A collection of convenient wrapper components around basic html elements.

HtmlAnchor.svelte

Renders a HTML link (anchor). External links will have noopener noreferrer rel and _blank target attributes applied. The only required prop is href.

Slot props

  • external (boolean): Wether the url is an external url.

HtmlImg.svelte

A wrapper around an html <img> element.

  • Automatically adds an empty alt attribute.
  • Only outputs src if there is no srcset.

HtmlVideo.svelte

A wrapper around an html video element.

  • Automatically adds playsinline if autoplay is true.
  • Automatically adds disableremoteplayback (can be removed by passing disableremoteplayback={false})
  • Automatically manages x-webkit-airplay attribute.

HtmlTime.svelte

A wrapper component arund the html element.

Props

  • date (Date): The date to display
  • formatOptions (FormatDateOptions): The date formatting options (see format package)

Slot props

  • formattedDate (string): The formatted date

Examples

<Time
	date={new Date('2023-04-17T21:34:50.360Z')}
	formatOptions={{ day: 'numeric', month: 'long', year: 'numeric' }}
/>
<Time
	date={new Date('2023-04-17T21:34:50.360Z')}
	formatOptions={{ day: 'numeric', month: 'long' }}
	let:formattedDate
>
	<span class="text-[red]">
		{formattedDate}
	</span>
</Time>
3.0.22

8 months ago

3.0.18

10 months ago

3.0.19

10 months ago

3.0.17

1 year ago

3.0.12

1 year ago

3.0.13

1 year ago

3.0.16

1 year ago

3.0.14

1 year ago

3.0.15

1 year ago

3.0.11

1 year ago

3.0.10

1 year ago

3.0.8

1 year ago

3.0.9

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.0.7

1 year ago

3.0.6

1 year ago

3.0.5

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.1

1 year ago