ThemeSwitch
The ThemeSwitch component allows users to toggle between light and dark themes in your Astro project.
Import
To use the ThemeSwitch component, first import it into your project:
Usage
Here's how you can use the textarea component in your Astro project:
Basic Usage
To create a basic textarea field, use the following code:
Props
Attribute | Type | Description | Default |
---|---|---|---|
label | string | The text label associated with the theme switch. | - |
class | string | CSS class for custom styling. | - |
Accessibility
-
Keyboard Accessibility: Ensure the ThemeSwitch component can be toggled using keyboard interactions (e.g., Enter key).