> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# border-radius

APISummary
## 介绍

用于添加圆角边框。

## 使用示例

**下面是一个示例: css-api**

**Entry:** `src/border-radius`
**Bundle:** `dist/border-radius.lynx.bundle`

```tsx
import { root } from "@lynx-js/react";
import "./index.scss";

const BorderRadius = () => {
  const scrollViewStyle = {
    height: "100%",
  };

  const fixedAreaStyle = {
    width: "100%",
    height: "100%",
    flexDirection: "column" as const,
  };

  const styles = [
    ["2em", "2em / 5em"],
    ["2em 1em 4em / 0.5em 3em", "15px 50px"],
    ["15px 50px 30px 5px", "1em 2em 4em 4em / 1em 2em 2em 8em"],
    ["100px 200px", "100px 30px / 10px"],
    ["100em / 200em", "2px 0px 2em / 0em 100px"],
  ];

  return (
    <scroll-view className="root" scroll-orientation="vertical" style={scrollViewStyle}>
      <view className="fixed_area" style={fixedAreaStyle}>
        {styles.map((row, rowIndex) => (
          <view key={`same-${rowIndex}`}>
            <view className="row">
              {row.map((radius, colIndex) => (
                <view
                  key={`same-${rowIndex}-${colIndex}`}
                  className={`box size0 styleDiff${colIndex} colorWidthSame`}
                  style={{ borderRadius: radius }}
                >
                  <text className="text">{radius}</text>
                </view>
              ))}
            </view>
          </view>
        ))}

        {styles.map((row, rowIndex) => (
          <view key={`diff-${rowIndex}`}>
            <view className="row">
              {row.map((radius, colIndex) => (
                <view
                  key={`diff-${rowIndex}-${colIndex}`}
                  className={`box size0 colorWidthDiff${colIndex}`}
                  style={{ borderRadius: radius }}
                >
                  <text className="text">{radius}</text>
                </view>
              ))}
            </view>
          </view>
        ))}
      </view>
    </scroll-view>
  );
};

root.render(<BorderRadius />);

```

v0.11.0



## Syntax

```css
border: solid 10px;
border-radius: 10px 40px 40px 10px;
```

```css
border: groove 1em red;
border-radius: 2em;
```

### 取值

- [`<length>`](/next/zh/api/css/data-type/length.md)
  定义圆角的形状。

- [`<percentage>`](/next/zh/api/css/data-type/percentage.md)
  以百分比定义圆角的形状

## 形式定义

| 初始值 | 0 |
| 适用元素 | all elements |
| 是否支持继承 | no |
| 是否支持动画 | no |


## 形式语法

```
[<length> | <percentage>]{1, 2}
```

## 与 Web 的区别

- [mdn:border-radius](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius)

不支持 inherit、initial、revert、unset 等

## 兼容性

**Compatibility Table**

**Query:** `css.properties.border-radius`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/12-border-radius.json) · [MDN](https://developer.mozilla.org/zh-CN/docs/Web/CSS/border-radius)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| border-radius | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`border-radius`**

**Specifications:**

