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

# border-width

APISummary
## Introduction

A shorthand property for setting the width of all four borders of an element. It corresponds to [`border-top-width`](/next/api/css/properties/border-top-width.md), [`border-right-width`](/next/api/css/properties/border-right-width.md), [`border-bottom-width`](/next/api/css/properties/border-bottom-width.md), and [`border-left-width`](/next/api/css/properties/border-left-width.md).

## Usage Examples

**This is an example below: css-api**

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

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

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

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

  const widthOptions = [
    ["thin", "thin medium"],
    ["thin medium thick", "thin medium thick 10px"],
    ["5px 1px 0px 15px", "0.5px 0.2em 5rpx"],
    ["0.2em 0.4em 0.5rem 3rpx", "thick 1px"],
  ];

  const widthOptions2 = [
    ["thick", "thick thin"],
    ["medium thick 1px", "thick 10px"],
    ["5px 0px 15px", "0.5px 5rpx 1rem"],
    ["0.2em 0.5rem 3rpx", "thick 6px"],
  ];

  return (
    <scroll-view className="root" scroll-orientation="vertical" style={scrollViewStyle}>
      <view className="fixed_area" style={fixedAreaStyle}>
        {widthOptions.map((row, rowIndex) => (
          <view key={`solid-${rowIndex}`}>
            <view className="row">
              {row.map((width, colIndex) => (
                <view
                  key={`solid-${rowIndex}-${colIndex}`}
                  className="box solid"
                  style={{ borderWidth: width }}
                >
                  <text className="text">{width}</text>
                </view>
              ))}
            </view>
          </view>
        ))}

        {widthOptions2.map((row, rowIndex) => (
          <view key={`style-${rowIndex}`}>
            <view className="row">
              {row.map((width, colIndex) => (
                <view
                  key={`style-${rowIndex}-${colIndex}`}
                  className={`box styleDiff${colIndex}`}
                  style={{ borderWidth: width }}
                >
                  <text className="text">{width}</text>
                </view>
              ))}
            </view>
          </view>
        ))}

        {widthOptions.map((row, rowIndex) => (
          <view key={`radius-${rowIndex}`}>
            <view className="row">
              {row.map((width, colIndex) => (
                <view
                  key={`radius-${rowIndex}-${colIndex}`}
                  className={`box styleDiff${colIndex} radiusStyle${colIndex}`}
                  style={{ borderWidth: width }}
                >
                  <text className="text">{width}</text>
                </view>
              ))}
            </view>
          </view>
        ))}
      </view>
    </scroll-view>
  );
};

root.render(<BorderWidth />);

```

v0.11.0



## Syntax

```css
border-width: thin medium thick 10px;
```

### Values

- thin | medium | thick | [`<length>`](/next/api/css/data-type/length.md)
- Supports 1-4 value syntax (top → right → bottom → left).

## Formal Definition

| Initial value | 0 |
| Applies to | All elements |
| Inherited | no |
| Animatable | yes |


## Formal Syntax

```css
border-width = [ <line-width> ]{1,4}
<line-width> = <length> | thin | medium | thick
```

## Differences from the Web

- [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width)
- Default value is different (Web default is `medium`).
- Does not support global values.

## Compatibility

**Compatibility Table**

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

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/17-border-width.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width)

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

**`border-width`**

**Specifications:**

