logoAnt Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
YouMindTRACTIANLobeHub
6.3.7
  • Components Overview
  • Changelog
    v6.3.7
  • General
    • Button
    • FloatButton
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
    • Grid
    • Layout
    • Masonry
      6.0.0
    • Space
    • Splitter
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
    • Tabs
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
      DEPRECATED
    • Popover
    • QRCode
    • Segmented
    • Statistic
    • Table
    • Tag
    • Timeline
    • Tooltip
    • Tour
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
  • Other
    • Affix
    • App
    • BorderBeam
      6.4.0
    • ConfigProvider
    • Util
When To Use
Examples
Basic
Gradients
API
BorderBeam
Design Token
FAQ
How does BorderBeam behave when reduced motion is enabled?
What does percent mean in color?
Why is BorderBeam not working?
How do I keep the beam radius aligned with my container?

BorderBeam

Decorative component that renders a moving beam along a container border.
Importimport { BorderBeam } from 'antd';
GitHub
components/border-beamIssueOpen issues
Docs
Edit this pageLLMs.md
Versionsupported since 6.4.0
contributors
    AppConfigProvider

    Resources

    Ant Design X
    Ant Design Charts
    Ant Design Pro
    Pro Components
    Ant Design Mobile
    Ant Design Mini
    Ant Design Web3
    Ant Design Landing-Landing Templates
    Scaffolds-Scaffold Market
    Umi-React Application Framework
    dumi-Component doc generator
    qiankun-Micro-Frontends Framework
    Ant Motion-Motion Solution
    China Mirror 🇨🇳

    Community

    Awesome Ant Design
    Medium
    X
    yuque logoAnt Design in YuQue
    Ant Design in Zhihu
    Experience Cloud Blog
    seeconf logoSEE Conf-Experience Tech Conference

    Help

    GitHub
    Change Log
    FAQ
    Bug Report
    Issues
    Discussions
    StackOverflow
    SegmentFault

    Ant XTech logoMore Products

    yuque logoYuQue-Document Collaboration Platform
    AntV logoAntV-Data Visualization
    Egg logoEgg-Enterprise Node.js Framework
    Kitchen logoKitchen-Sketch Toolkit
    Galacean logoGalacean-Interactive Graphics Solution
    WeaveFox logoWeaveFox-AI Development with WeaveFox 🦊
    xtech logoAnt Financial Experience Tech
    Theme Editor
    Made with ❤ by
    Ant Group and Ant Design Community
    loading

    When To Use

    • Use when a container needs stronger visual emphasis without introducing business state semantics.
    • Suitable for login panels, recommendation cards, AI modules, and key CTA blocks.
    • As a decorative effect, it should not replace focus rings, validation borders, or status feedback.

    Examples

    API

    Common props ref:Common props

    BorderBeam

    PropertyDescriptionTypeDefaultVersionGlobal Config
    childrenDecorated contentReactNode-6.4.0×
    colorBeam color configuration. Supports a single color string or gradient stops. percent uses the 0 ~ 100 input range and BorderBeam reserves tail space for the transparent fadestring | { color: string; percent: number }[]-6.4.0×
    outsetOutset distance of the beam layer from the container edge. Set to 0 for clipped containersnumber | string-6.4.0×

    Design Token

    Global TokenHow to use?

    FAQ

    How does BorderBeam behave when reduced motion is enabled?

    BorderBeam treats the beam as a decorative effect. When prefers-reduced-motion: reduce is active, the beam effect is hidden.

    What does percent mean in color?

    percent represents the authored stop position and accepts values from 0 to 100. BorderBeam maps those stops into the visible beam segment and reserves the trailing area for transparent fade-out so the moving tail stays visible.

    Why is BorderBeam not working?

    BorderBeam needs to resolve the actual DOM node from children and insert the beam layer into that node. Make sure the wrapped content is a native DOM element, or a React component that correctly forwards its ref to a DOM element. Otherwise BorderBeam cannot locate the real container and the beam cannot be rendered.

    The beam layer is positioned with position: absolute, so the resolved DOM node also needs to provide a positioning context. In most cases, set position: relative on the wrapped element. BorderBeam does not inspect or patch the child positioning style for you.

    For performance reasons, whether children can host the beam and its positioning information are resolved during initialization, and are not continuously updated when the child structure or positioning styles change later.

    How do I keep the beam radius aligned with my container?

    BorderBeam reads the computed border-radius from the actual container during initialization. This works best for a single-container child such as Card; for more complex child trees, set the radius on the actual container root for a more deterministic result.

    For performance reasons, the radius is not continuously measured after the initial calculation. Later radius changes caused by size, ancestor styles, or internal child state are not guaranteed to resync automatically. The running beam may still apply internal motion smoothing.

    For example:

    tsx
    const radius = 24;
    <BorderBeam>
    <Card style={{ borderRadius: radius }} />
    </BorderBeam>;
    Basic

    Basic usage. Wrap any container with BorderBeam to add a continuous decorative beam effect along its border.

    CodeSandbox Icon
    Hitu Icon
    codepen icon
    External Link Icon
    Expand Icon
    Gradients

    Display six gradient beam palettes and switch between them.

    CodeSandbox Icon
    Hitu Icon
    codepen icon
    External Link Icon
    Expand Icon
    Workspace overview
    Review task status, deployment health, and recent automation activity in one panel.
    Ocean
    Dashboard
    A calm blue-green accent that works well for data views and cloud tooling.
    #1677ff · 0%#36cfc9 · 52%#95de64 · 100%
    Stop positions use the public 0-100 input range.