Skip to content

Pinwheel Compound

Used to select options.

Importing

To use the pinwheel component, first you need to register the component inside the page. You can register the component manually by importing the register function:

ts
import { register } from "@tapsioss/web-components/pinwheel";

register(); // Now the pinwheel component is ready to use!
ts
import { registerPinwheel } from "@tapsioss/web-components";

registerPinwheel(); // Now the pinwheel component is ready to use!

Also you can automatically register the component by importing it with the following approach:

ts
import "@tapsioss/web-components/pinwheel/element";

TIP

If you want to use all the component in your app, you can call registerAll at the root of your project.

ts
import { registerAll } from "@tapsioss/web-components";

registerAll(); // All the components are now available

INFO

By registering the pinwheel component, its compound parts will also be registered:

  • tapsi-pinwheel-item

In the React package, you can easily add the component using the following code:

ts
import { Pinwheel } from "@tapsioss/react-components";

Component Usage

html
<tapsi-pinwheel></tapsi-pinwheel>
tsx
<Pinwheel />

Properties

NameAttribute NameDescriptionTypeDefault Value
valueMinvalueminDefines the minimum allowed value for pinwheel.
Use it when your items' values are sequential numbers.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuemin
string""
valueMaxvaluemaxDefines the maximum allowed value for pinwheel.
Use it when your items' values are sequential numbers.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuemax
string""
labellabelDefines a string value that can be used to name input.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label
string""
labelledBylabelledbyIdentifies the element (or elements) that labels the input.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby
string""
autofocusautofocusIndicates that the element should be focused on page load.

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
booleanfalse
valuevalueThe value of the currently selected item.string""

Methods

NameDescriptionParameters
setViewOnItem-Name: itemValue
Type: (string)
formDisabledCallback-Name: disabled
Type: (boolean)

Slots

NameValueDescription
DEFAULT-The default slot for the content.

TIP

The value of slots are available for developer as JavaScript Variables:

ts
// Option 1
import { PinwheelSlots, PinwheelItemSlots } from "@tapsioss/web-components";

// Option 2
import { Slots, ItemSlots } from "@tapsioss/web-components/pinwheel";
ts
// Option 1
import { PinwheelSlots, PinwheelItemSlots } from "@tapsioss/react-components";

// Option 2
import { Slots, ItemSlots } from "@tapsioss/react-components/Pinwheel";

Events

NameDescriptionTypeBubblesCancelable
changeFires when the pinwheel selected state changes.Event

Compound Parts

Item

The item part of the Pinwheel component.

Importing

By registering the parent component, the pinwheel item will also be registered.

In the React package, you can easily add the component using the following code:

ts
import { PinwheelItem } from "@tapsioss/react-components";

Component Usage

html
<tapsi-pinwheel-item></tapsi-pinwheel-item>
tsx
<PinwheelItem />

Properties

NameAttribute NameDescriptionTypeDefault Value
selectedselectedIndicates whether the item is selected or not.booleanfalse
valuevalueThe value associated with the item.
This value has to be unique among sibling items.
string""

Slots

NameValueDescription
DEFAULT-The default slot for the content.

Created with 🧡