# Borders

Customize the borders and border-radius of elements using border utility classes. These utilities are ideal for styling images, buttons, and various other components with minimal effort.

## Add borders

Add borders to elements:

```
<span class="border"></span>
<span class="border-top"></span>
<span class="border-end"></span>
<span class="border-bottom"></span>
<span class="border-start"></span>
```

## Remove borders

Remove borders from elements:

```
<span class="border border-0"></span>
<span class="border border-top-0"></span>
<span class="border border-end-0"></span>
<span class="border border-bottom-0"></span>
<span class="border border-start-0"></span>
```

## Radius

Add `4px` rounded corners to an element:

```
<span class="rounded"></span>
<span class="rounded-top"></span>
<span class="rounded-end"></span>
<span class="rounded-bottom"></span>
<span class="rounded-start"></span>
```

Customize the radius using the following utils:

```
<span class="rounded-0"></span>
<span class="rounded-1"></span>
<span class="rounded-2"></span>
<span class="rounded-circle">Circle</span>
<span class="rounded-pill">Rounded</span>
```

> **Note:** Since `rounded-2` is the default shape for *Element*, it is possible to use the shorthand `rounded` CSS class.

## Examples

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';

@Component({
  selector: 'app-sample',
  templateUrl: './borders.html',
  styles: `
    :host {
      .example {
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
        margin-block-end: 1rem;
      }
      span {
        padding: 2rem;
        background-color: rgb(from var(--si-sys-color-border-2) r g b / 0.3);
      }
    }
  `,
  host: {
    class: 'p-5'
  }
})
export class SampleComponent {}
```

Template:

```html
<h3>Add borders</h3>
<div class="example">
  <span class="border">border</span>
  <span class="border-top">border-top</span>
  <span class="border-end">border-end</span>
  <span class="border-bottom">border-bottom</span>
  <span class="border-start">border-start</span>
</div>
<h3>Remove borders</h3>
<div class="example">
  <span class="border border-0">border-0</span>
  <span class="border border-top-0">border-top-0</span>
  <span class="border border-end-0">border-end-0</span>
  <span class="border border-bottom-0">border-bottom-0</span>
  <span class="border border-start-0">border-start-0</span>
</div>
```

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';

@Component({
  selector: 'app-sample',
  templateUrl: './shapes.html',
  styles: `
    :host {
      .example {
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
        margin-block-end: 1rem;
      }
      span {
        padding: 2rem;
        background-color: var(--si-sys-color-background-information-subtle);
      }
    }
  `,
  host: {
    class: 'p-5'
  }
})
export class SampleComponent {}
```

Template:

```html
<h3>Add rounded corners</h3>
<div class="example">
  <span class="rounded">rounded</span>
  <span class="rounded-top">rounded-top</span>
  <span class="rounded-end">rounded-end</span>
  <span class="rounded-bottom">rounded-bottom</span>
  <span class="rounded-start">rounded-start</span>
</div>
<h3>Customize rounded corner radius</h3>
<div class="example">
  <span class="rounded-0">rounded-0 - 0px</span>
  <span class="rounded-1">rounded-1 - 4px</span>
  <span class="rounded-2">rounded-2 - 8px</span>
  <span class="rounded-circle">rounded-circle - 50%</span>
  <span class="rounded-pill">rounded-pill - 50rem</span>
</div>
```
