@code {
[CascadingParameter] private BreakpointState? _state { get; set; }
}Breakpoints
Responsive breakpoint system for viewport-based conditional rendering. Provides centralized breakpoint detection with cascading state distribution for responsive UI components.
Current Breakpoint
Resize your browser window to see the breakpoint change in real-time. The system detects viewport size and cascades the current breakpoint state to all child components.
FOD Design System Breakpoints
The breakpoint values match the FOD Design System breakpoints. Each breakpoint defines a minimum width threshold for responsive design.
| Breakpoint | Min Width | Range | Status |
|---|---|---|---|
| Xs | 0px | 0-575px | |
| Sm | 576px | 576-767px | |
| Md | 768px | 768-991px | |
| Lg | 992px | 992-1279px | |
| Xl | 1280px | 1280-1439px | |
| Xxl | 1440px | 1440px+ |
public enum Breakpoint
{
Xs = 1, // 0-575px
Sm = 2, // 576-767px
Md = 3, // 768-991px
Lg = 4, // 992-1279px
Xl = 5, // 1280-1439px
Xxl = 6 // 1440px+
}FodHidden
Conditionally hide content based on breakpoint conditions. Resize your browser to see the content appear and disappear based on the current viewport size.
Hide on Small Screens (SmDown)
Hide on Large Screens (LgUp)
Show Only at Specific Breakpoint
This content disappears only when the viewport is at the Md breakpoint.
<FodHidden SmDown="true">
<p>Visible on Md and larger</p>
</FodHidden>
<FodHidden LgUp="true">
<p>Hidden on Lg and larger</p>
</FodHidden>
<FodHidden Only="new[] { Breakpoint.Md }">
<p>Hidden only at Md</p>
</FodHidden>Rendering Strategies
FodHidden supports two strategies: DoNotRender (default, removes from DOM) and CssHide (keeps in DOM with display:none). Choose based on your performance and SEO requirements.
DoNotRender (Default)
Content is completely removed from the DOM. Best for performance when content is not needed for SEO or accessibility.
CssHide
Content remains in DOM with display:none. Use for SEO-critical content or screen reader accessibility.
<!-- DoNotRender: Element removed from DOM (default) -->
<FodHidden SmDown="true" Strategy="HiddenStrategy.DoNotRender">
<p>Performance-optimized hiding</p>
</FodHidden>
<!-- CssHide: Element stays in DOM with display:none -->
<FodHidden SmDown="true" Strategy="HiddenStrategy.CssHide">
<p>SEO and accessibility-friendly hiding</p>
</FodHidden>Best Practices
Guidelines for effective responsive design with the breakpoint system.
Mobile-First Approach
Design for mobile first, then progressively enhance for larger screens. Use SmUp, MdUp, LgUp for showing content as screens get larger.
<FodHidden
MdDown="true">Desktop features</FodHidden>
Show advanced features only on desktop
Performance Optimization
Use DoNotRender (default) for content that doesn't need to be in the DOM. Reserve CssHide for SEO-critical content.
Strategy="HiddenStrategy.DoNotRender"
Default behavior, best for performance
Accessibility Considerations
Use CssHide when content should remain accessible to screen readers. Avoid hiding critical navigation or form labels.
Strategy="HiddenStrategy.CssHide"
Keeps content accessible to assistive technologies
Cascading State Pattern
BreakpointState is provided via cascading parameter. Access it in any component without prop drilling.
[CascadingParameter] private BreakpointState? _state@* Mobile-first: Show on larger screens *@
<FodHidden MdDown="true">
<AdvancedFeatures />
</FodHidden>
@* Performance: Remove from DOM *@
<FodHidden SmDown="true" Strategy="HiddenStrategy.DoNotRender">
<HeavyComponent />
</FodHidden>
@* Accessibility: Keep in DOM for screen readers *@
<FodHidden LgUp="true" Strategy="HiddenStrategy.CssHide">
<NavigationMenu />
</FodHidden>API Reference
Complete list of FodHidden component parameters and their usage.
