@@ -166,7 +166,11 @@ interface ChakraNavProps {
166
166
brandTo? : string
167
167
}
168
168
169
- export function ChakraNav({ items , brand = ' Logo' , brandTo = ' /' }: ChakraNavProps ) {
169
+ export function ChakraNav({
170
+ items ,
171
+ brand = ' Logo' ,
172
+ brandTo = ' /' ,
173
+ }: ChakraNavProps ) {
170
174
const { isOpen, onToggle } = useDisclosure ()
171
175
const matchRoute = useMatchRoute ()
172
176
@@ -190,7 +194,9 @@ export function ChakraNav({ items, brand = 'Logo', brandTo = '/' }: ChakraNavPro
190
194
>
191
195
<IconButton
192
196
onClick = { onToggle }
193
- icon = { isOpen ? <CloseIcon w = { 3 } h = { 3 } /> : <HamburgerIcon w = { 5 } h = { 5 } />}
197
+ icon = {
198
+ isOpen ? <CloseIcon w = { 3 } h = { 3 } /> : <HamburgerIcon w = { 5 } h = { 5 } />
199
+ }
194
200
variant = " ghost"
195
201
aria-label = " Toggle Navigation"
196
202
/>
@@ -255,7 +261,11 @@ function MobileNav({ items }: { items: NavItem[] }) {
255
261
const matchRoute = useMatchRoute ()
256
262
257
263
return (
258
- <Stack bg = { useColorModeValue (' white' , ' gray.800' )} p = { 4 } display = { { md: ' none' }} >
264
+ <Stack
265
+ bg = { useColorModeValue (' white' , ' gray.800' )}
266
+ p = { 4 }
267
+ display = { { md: ' none' }}
268
+ >
259
269
{ items .map ((item ) => {
260
270
const isActive = matchRoute ({ to: item .to , fuzzy: ! item .exact })
261
271
@@ -265,7 +275,9 @@ function MobileNav({ items }: { items: NavItem[] }) {
265
275
to = { item .to }
266
276
py = { 2 }
267
277
fontWeight = { isActive ? ' bold' : ' medium' }
268
- color = { isActive ? ' brand.500' : useColorModeValue (' gray.600' , ' gray.200' )}
278
+ color = {
279
+ isActive ? ' brand.500' : useColorModeValue (' gray.600' , ' gray.200' )
280
+ }
269
281
_hover = { {
270
282
textDecoration: ' none' ,
271
283
}}
@@ -313,7 +325,8 @@ export function ChakraBreadcrumb({
313
325
314
326
const breadcrumbItems = pathSegments .map ((segment , index ) => {
315
327
const path = ' /' + pathSegments .slice (0 , index + 1 ).join (' /' )
316
- const label = config [segment ] || segment .charAt (0 ).toUpperCase () + segment .slice (1 )
328
+ const label =
329
+ config [segment ] || segment .charAt (0 ).toUpperCase () + segment .slice (1 )
317
330
const isLast = index === pathSegments .length - 1
318
331
319
332
return {
@@ -431,7 +444,11 @@ export function ChakraCardGrid({
431
444
})
432
445
433
446
return (
434
- <SimpleGrid columns = { columns } spacing = { spacing } minChildWidth = { minChildWidth } >
447
+ <SimpleGrid
448
+ columns = { columns }
449
+ spacing = { spacing }
450
+ minChildWidth = { minChildWidth }
451
+ >
435
452
{ children }
436
453
</SimpleGrid >
437
454
)
@@ -602,7 +619,11 @@ function PostPage() {
602
619
<VStack spacing = { 8 } align = " stretch" >
603
620
{ /* Back Navigation */ }
604
621
<Box >
605
- <RouterLink to = " /posts" color = " brand.500" _hover = { { textDecoration: ' none' }} >
622
+ <RouterLink
623
+ to = " /posts"
624
+ color = " brand.500"
625
+ _hover = { { textDecoration: ' none' }}
626
+ >
606
627
<HStack spacing = { 2 } >
607
628
<ArrowBackIcon />
608
629
<Text >Back to Posts</Text >
@@ -613,7 +634,7 @@ function PostPage() {
613
634
{ /* Post Header */ }
614
635
<VStack spacing = { 4 } align = " start" >
615
636
<Heading size = " 2xl" >Understanding TanStack Router</Heading >
616
-
637
+
617
638
<HStack spacing = { 3 } >
618
639
<Tag colorScheme = " brand" >
619
640
<TagLabel >Tutorial</TagLabel >
@@ -630,15 +651,16 @@ function PostPage() {
630
651
<Box >
631
652
<VStack spacing = { 4 } align = " start" >
632
653
<Text color = { textColor } lineHeight = " tall" >
633
- This is the detailed content of post { postId } . In this comprehensive guide,
634
- we'll explore how to integrate TanStack Router with Chakra UI to create
635
- beautiful, accessible, and responsive web applications.
654
+ This is the detailed content of post { postId } . In this
655
+ comprehensive guide, we'll explore how to integrate TanStack
656
+ Router with Chakra UI to create beautiful, accessible, and
657
+ responsive web applications.
636
658
</Text >
637
659
638
660
<Text color = { textColor } lineHeight = " tall" >
639
- Chakra UI provides a simple, modular, and accessible component library
640
- that gives you the building blocks you need to build React applications
641
- with speed.
661
+ Chakra UI provides a simple, modular, and accessible component
662
+ library that gives you the building blocks you need to build React
663
+ applications with speed.
642
664
</Text >
643
665
</VStack >
644
666
</Box >
@@ -724,12 +746,12 @@ export const RouterButton = createLink(
724
746
import { ColorModeScript } from ' @chakra-ui/react'
725
747
726
748
// Add to your index.html head
727
- <ColorModeScript initialColorMode = { theme .config .initialColorMode } />
749
+ ; < ColorModeScript initialColorMode = {theme.config.initialColorMode } / >
728
750
729
751
// Or use localStorage manager
730
752
import { localStorageManager } from ' @chakra-ui/react'
731
753
732
- <ChakraProvider theme = { theme } colorModeManager = { localStorageManager } >
754
+ ; < ChakraProvider theme = {theme } colorModeManager = {localStorageManager }>
733
755
{children }
734
756
< / ChakraProvider >
735
757
```
@@ -763,24 +785,28 @@ const columns = useBreakpointValue({
763
785
Before deploying your Chakra UI + TanStack Router app:
764
786
765
787
### Functionality
788
+
766
789
- [ ] All router-compatible components work correctly
767
790
- [ ] Navigation states properly reflected
768
791
- [ ] Theme persists across route changes
769
792
- [ ] TypeScript compilation successful
770
793
771
794
### Accessibility
795
+
772
796
- [ ] Keyboard navigation working
773
797
- [ ] Screen reader compatibility tested
774
798
- [ ] Color contrast meets WCAG standards
775
799
- [ ] Focus management working properly
776
800
777
801
### Performance
802
+
778
803
- [ ] Bundle size optimized
779
804
- [ ] Color mode switching performant
780
805
- [ ] No unnecessary re-renders
781
806
- [ ] Images and icons optimized
782
807
783
808
### Responsiveness
809
+
784
810
- [ ] Works on mobile devices
785
811
- [ ] Tablet layouts functional
786
812
- [ ] Desktop experience optimal
@@ -793,4 +819,4 @@ Before deploying your Chakra UI + TanStack Router app:
793
819
- [Chakra UI Documentation](https://chakra-ui.com/getting-started) - Complete component library guide
794
820
- [Chakra UI Recipes](https://chakra-ui.com/community/recipes) - Common patterns and recipes
795
821
- [TanStack Router createLink API](../api/router#createlink) - API documentation for component integration
796
- - [Emotion CSS-in-JS](https://emotion.sh/docs/introduction) - Styling library used by Chakra UI
822
+ - [Emotion CSS-in-JS](https://emotion.sh/docs/introduction) - Styling library used by Chakra UI
0 commit comments