# Code Example 3 - Theme switching hook example with interactive code

> This component showcases the use of custom hooks to manage and toggle themes within a React application. It includes interactive code blocks and provides a clear implementation example, demonstrating how to integrate theme switching with a button and visual indicators.

A paid shadcn/ui block sold by the [@shadcnblocks](https://shadcnblocks.com/?utm_source=shadcn.exchange) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/shadcnblocks/code-example3).

- Page, with a preview: https://shadcn.exchange/r/shadcnblocks/code-example3
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/shadcnblocks/code-example3-light-98514d729cdfbfe6.png
- Listed: 2026-10-13

## Buy and install

@shadcnblocks sells this block, and its code is not on shadcn.exchange. Buy it from the registry, which installs it for those who have: https://shadcn.exchange/out/shadcnblocks/code-example3
