Panel

Panels are overlays that contain supplementary content and are used for complex creation, edit, or management experiences. For example, viewing details about an item in a list or editing settings.

Usage

Basic
<BitButton OnClick="() => isBasicPanelOpen = true">Open Panel</BitButton>
<BitPanel @bind-IsOpen="isBasicPanelOpen">
    <div style="max-width:300px;padding:1rem">
        Once upon a time, stories wove connections between people, a symphony of voices crafting shared dreams. 
        Each word carried meaning, each pause brought understanding. Placeholder text reminds us of that moment 
        when possibilities are limitless, waiting for content to emerge. The spaces here are open for growth, 
        for ideas that change minds and spark emotions. This is where the journey begins your words will lead the way.
    </div>
</BitPanel>
@code {
    private bool isBasicPanelOpen;
}
                    
Advanced options
BitPanel has some advanced options to be customized.


Blocking:




Modeless:




AutoToggleScroll:

<BitButton OnClick="() => isBlockingPanelOpen = true">Open Panel</BitButton>
<BitPanel @bind-IsOpen="isBlockingPanelOpen" Blocking>
    <div style="max-width:300px;padding:1rem">
        <h3>Blocking</h3>
        <div>
            Once upon a time, stories wove connections between people, a symphony of voices crafting shared dreams. 
            Each word carried meaning, each pause brought understanding. Placeholder text reminds us of that moment 
            when possibilities are limitless, waiting for content to emerge. The spaces here are open for growth, 
            for ideas that change minds and spark emotions. This is where the journey begins your words will lead the way.
        </div>
        <BitButton OnClick="() => isBlockingPanelOpen = false">Close</BitButton>
    </div>
</BitPanel>

<BitButton OnClick="() => isModelessPanelOpen = true">Open Panel</BitButton>
<BitPanel @bind-IsOpen="isModelessPanelOpen" @ref="modelessPanelRef" Modeless>
    <div style="max-width:300px;padding:1rem">
        <h3>Modeless</h3>
        <div>
            Once upon a time, stories wove connections between people, a symphony of voices crafting shared dreams. 
            Each word carried meaning, each pause brought understanding. Placeholder text reminds us of that moment 
            when possibilities are limitless, waiting for content to emerge. The spaces here are open for growth, 
            for ideas that change minds and spark emotions. This is where the journey begins your words will lead the way.
        </div>
        <BitButton OnClick="() => modelessPanelRef.Close()">Close</BitButton>
    </div>
</BitPanel>

<BitButton OnClick="() => isAutoToggleScrollPanelOpen = true">Open Panel</BitButton>
<BitPanel @bind-IsOpen="isAutoToggleScrollPanelOpen" AutoToggleScroll>
    <div style="max-width:300px;padding:1rem">
        <h3>AutoToggleScroll</h3>
        Once upon a time, stories wove connections between people, a symphony of voices crafting shared dreams. 
        Each word carried meaning, each pause brought understanding. Placeholder text reminds us of that moment 
        when possibilities are limitless, waiting for content to emerge. The spaces here are open for growth, 
        for ideas that change minds and spark emotions. This is where the journey begins your words will lead the way.
    </div>
</BitPanel>
@code {
    private bool isBlockingPanelOpen;
    private bool isModelessPanelOpen;
    private BitPanel modelessPanelRef = default!;
    private bool isAutoToggleScrollPanelOpen;
}
                    
Position and size
To set the Panel position on the page you can use the Position parameter.


<BitNumberField @bind-Value="customPanelSize" Mode="BitSpinButtonMode.Inline" Label="Custom size" />

<BitButton OnClick="() => isOpenInPositionStart = true">Start</BitButton>
<BitButton OnClick="() => isOpenPositionEnd = true">End</BitButton>
<BitButton OnClick="() => isOpenInPositionTop = true">Top</BitButton>
<BitButton OnClick="() => isOpenInPositionBottom = true">Bottom</BitButton>

<BitPanel @bind-Size="customPanelSize"
            @bind-IsOpen="isOpenInPositionStart"
            Position="BitPanelPosition.Start">
    <div style="padding:1rem">
        BitPanel with Start position and custom Size.
        <BitNumberField @bind-Value="customPanelSize" Mode="BitSpinButtonMode.Inline" Label="Custom size" />
    </div>
</BitPanel>

<BitPanel @bind-Size="customPanelSize"
            @bind-IsOpen="isOpenPositionEnd"
            Position="BitPanelPosition.End">
    <div style="padding:1rem">
        BitPanel with End position and custom Size.
        <BitNumberField @bind-Value="customPanelSize" Mode="BitSpinButtonMode.Inline" Label="Custom size" />
    </div>
</BitPanel>

<BitPanel @bind-Size="customPanelSize" @bind-IsOpen="isOpenInPositionTop" Position="BitPanelPosition.Top">
    <div style="padding:1rem">
        BitPanel with Top position and custom Size.
        <BitNumberField @bind-Value="customPanelSize" Mode="BitSpinButtonMode.Inline" Label="Custom size" />
    </div>
</BitPanel>

<BitPanel @bind-Size="customPanelSize"
            @bind-IsOpen="isOpenInPositionBottom"
            Position="BitPanelPosition.Bottom">
    <div style="padding:1rem">
        BitPanel with Bottom position and custom Size.
        <BitNumberField @bind-Value="customPanelSize" Mode="BitSpinButtonMode.Inline" Label="Custom size" />
    </div>
</BitPanel>
@code {
    private double customPanelSize = 300;
    private bool isOpenInPositionStart;
    private bool isOpenPositionEnd;
    private bool isOpenInPositionTop;
    private bool isOpenInPositionBottom;
}
                    
Style & Class
Explore styling and class customization for BitPanel, including component styles, custom classes, and detailed styles.


Component's Style & Class:







Styles & Classes:



<BitButton OnClick="() => isStyledPanelOpen = true">Open Styled panel</BitButton>
<BitPanel @bind-IsOpen="isStyledPanelOpen" Style="font-size: 3rem;">
    <div style="padding:1rem">
        BitPanel with custom style.
    </div>
</BitPanel>

<BitButton OnClick="() => isClassedPanelOpen = true">Open Classed panel</BitButton>
<BitPanel @bind-IsOpen="isClassedPanelOpen" Class="custom-class">
    <div style="padding:1rem">
        BitPanel with custom class:
        <div class="item">Item 1</div>
        <div class="item">Item 2</div>
        <div class="item">Item 3</div>
    </div>
</BitPanel>

<BitButton OnClick="() => isPanelStylesOpen = true">Open panel Styles</BitButton>
<BitPanel @bind-IsOpen="isPanelStylesOpen"
          Styles="@(new() { Overlay = "background-color: #4776f433;",
                            Container = "padding: 1rem; box-shadow: 0 0 1rem tomato;" })">
    BitPanel with <b>Styles</b> to customize its elements.
</BitPanel>

<BitButton OnClick="() => isPanelClassesOpen = true">Open panel Classes</BitButton>
<BitPanel @bind-IsOpen="isPanelClassesOpen"
          Classes="@(new() { Container = "custom-container",
                             Overlay = "custom-overlay" })">
    BitPanel with <b>Classes</b> to customize its elements.
</BitPanel>
@code {
    private bool isStyledPanelOpen;
    private bool isClassedPanelOpen;
    private bool isPanelStylesOpen;
    private bool isPanelClassesOpen;
}
                    
RTL
Use BitPanel in right-to-left (RTL).


<BitButton OnClick="() => isRtlPanelOpenStart = true">آغاز</BitButton>
<BitButton OnClick="() => isRtlPanelOpenEnd = true">پایان</BitButton>

<BitPanel @bind-IsOpen="isRtlPanelOpenStart"
          Dir="BitDir.Rtl"
          Position="BitPanelPosition.Start">
    <div style="max-width:300px;padding:1rem">
        لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است.
        چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد.
        کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد.
        در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها و شرایط سخت تایپ به پایان رسد وزمان مورد نیاز شامل حروفچینی دستاوردهای اصلی و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد.
    </div>
</BitPanel
<BitPanel @bind-IsOpen="isRtlPanelOpenEnd"
          Dir="BitDir.Rtl"
          Position="BitPanelPosition.End">
    <div style="max-width:300px;padding:1rem">
        لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است.
        چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد.
        کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد.
        در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها و شرایط سخت تایپ به پایان رسد وزمان مورد نیاز شامل حروفچینی دستاوردهای اصلی و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد.
    </div>
</BitPanel>
@code {
    private bool isRtlPanelOpenStart;
    private bool isRtlPanelOpenEnd;
}
                    

API

BitPanel parameters
Name
Type
Default value
Description
AutoToggleScroll bool false Enables the auto scrollbar toggle behavior of the panel.
Blocking bool false Whether the panel can be dismissed by clicking outside of it on the overlay.
ChildContent RenderFragment? null The content of the panel.
Classes BitPanelClassStyles? null Custom CSS classes for different parts of the panel.
IsOpen bool false Determines the openness of the panel.
Modeless bool false Removes the overlay element of the panel.
OnDismiss EventCallback<MouseEventArgs> A callback function for when the Panel is dismissed.
OnSwipeStart EventCallback<decimal> The event callback for when the swipe action starts on the container of the panel.
OnSwipeMove EventCallback<decimal> The event callback for when the swipe action moves on the container of the panel.
OnSwipeEnd EventCallback<decimal> The event callback for when the swipe action ends on the container of the panel.
Position BitPanelPosition? null The position of the panel to show on the screen.
Size double? null The value of the height or width (based on the position) of the Panel.
ScrollerSelector string null Specifies the element selector for which the Panel disables its scroll if applicable.
Styles BitPanelClassStyles? null Custom CSS styles for different parts of the panel component.
SwipeTrigger decimal? null The swiping point (difference percentage) based on the width of the panel container to trigger the close action (default is 0.25m).
BitComponentBase parameters
Name
Type
Default value
Description
AriaLabel string? null The aria-label of the control for the benefit of screen readers.
Class string? null Custom CSS class for the root element of the component.
Dir BitDir? null Determines the component direction.
HtmlAttributes Dictionary<string, object> new Dictionary<string, object>() Capture and render additional attributes in addition to the component's parameters.
Id string? null Custom id attribute for the root element. if null the UniqueId will be used instead.
IsEnabled bool true Whether or not the component is enabled.
Style string? null Custom CSS style for the root element of the component.
Visibility BitVisibility BitVisibility.Visible Whether the component is visible, hidden or collapsed.
BitComponentBase public members
Name
Type
Default value
Description
UniqueId Guid Guid.NewGuid() The readonly unique id of the root element. it will be assigned to a new Guid at component instance construction.
RootElement ElementReference The ElementReference of the root element.
BitPanelClassStyles properties
Name
Type
Default value
Description
Root string? null Custom CSS classes/styles for the root element of the BitPanel.
Overlay string? null Custom CSS classes/styles for the overlay of the BitPanel.
Container string? null Custom CSS classes/styles for the container of the BitPanel.
BitPanelPosition enum
Name
Value
Description
Start 0
End 1
Top 2
Bottom 3
BitVisibility enum
Name
Value
Description
Visible 0 The content of the component is visible.
Hidden 1 The content of the component is hidden, but the space it takes on the page remains (visibility:hidden).
Collapsed 2 The component is hidden (display:none).
BitDir enum
Name
Value
Description
Ltr 0 Ltr (left to right) is to be used for languages that are written from the left to the right (like English).
Rtl 1 Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic).
Auto 2 Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.

Feedback

You can give us your feedback through our GitHub repo by filing a new Issue or starting a new Discussion.

Or you can review / edit this page on GitHub.

Or you can review / edit this component on GitHub.
  • On this page