From dfdd51cf8e1b163b5e5b49460c4fbd3081441ade Mon Sep 17 00:00:00 2001 From: ocavue Date: Thu, 16 Jan 2025 22:55:36 +1100 Subject: [PATCH] update readme --- README.md | 58 ++++++++++++++++++++++++------------------------------- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 9460c6b..97dee7c 100644 --- a/README.md +++ b/README.md @@ -31,41 +31,33 @@ npm install astro-theme-toggle ``` -2. Add a button to your `` to toggle the theme: +2. Add the `Toggle` component to your `` to toggle the theme: ```astro - - - - - + --- + import { Toggle } from 'astro-theme-toggle' + --- + + + ``` + +3. You can customize the icon by passing a `Fragment` with the `icon-light` and `icon-dark` slots. + + ```astro + --- + import { Toggle } from 'astro-theme-toggle' + import MyLightIcon from './my-light-icon.astro' + import MyDarkIcon from './my-dark-icon.astro' + --- + + + + + + + + + ``` ## Live Examples