---
title: "Framed"
language: "en"
type: "Symbol"
summary: "Framed[expr] displays a framed version of expr."
keywords: 
- framed (Version 1 option)
- framebox
- bounding rectangle
canonical_url: "https://reference.wolfram.com/language/ref/Framed.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Viewers and Annotation"
    link: "https://reference.wolfram.com/language/guide/ViewersAndAnnotation.en.md"
  - 
    title: "Annotating & Combining Graphics"
    link: "https://reference.wolfram.com/language/guide/AnnotatingAndCombiningGraphics.en.md"
  - 
    title: "Chart Labeling, Legending & Annotation"
    link: "https://reference.wolfram.com/language/guide/ChartLabelingLegendingAndAnnotation.en.md"
  - 
    title: "Mathematical Typesetting"
    link: "https://reference.wolfram.com/language/guide/MathematicalTypesetting.en.md"
  - 
    title: "Graphics Annotation & Appearance"
    link: "https://reference.wolfram.com/language/guide/GraphicsAnnotationAndAppearance.en.md"
  - 
    title: "Notebook Document Generation"
    link: "https://reference.wolfram.com/language/guide/DocumentGeneration.en.md"
related_workflows: 
  - 
    title: "Put a Frame Around a Cell"
    link: "https://reference.wolfram.com/language/workflow/PutAFrameAroundACell.en.md"
related_functions: 
  - 
    title: "Labeled"
    link: "https://reference.wolfram.com/language/ref/Labeled.en.md"
  - 
    title: "Frame"
    link: "https://reference.wolfram.com/language/ref/Frame.en.md"
  - 
    title: "Panel"
    link: "https://reference.wolfram.com/language/ref/Panel.en.md"
  - 
    title: "Highlighted"
    link: "https://reference.wolfram.com/language/ref/Highlighted.en.md"
related_tutorials: 
  - 
    title: "Formatted Output"
    link: "https://reference.wolfram.com/language/tutorial/TextualInputAndOutput.en.md#6589676"
---
# Framed

Framed[expr] displays a framed version of expr.

## Details and Options

* The following options can be given:

|                   |           |                                                           |
| :---------------- | :-------- | :-------------------------------------------------------- |
| Background        | None      | background color                                          |
| BaselinePosition  | Automatic | alignment relative to surrounding text                    |
| BaseStyle         | {}        | base style specifications for the frame                   |
| ContentPadding    | True      | whether to shrink the margins tightly around the contents |
| FrameMargins      | Automatic | margins to leave inside the frame                         |
| FrameStyle        | Automatic | graphics directives giving a style for the frame          |
| ImageMargins      | 0         | margins around the image of the displayed frame           |
| ImageSize         | Automatic | the overall image size of the displayed frame             |
| RoundingRadius    | 0         | radius for rounded corners                                |

* If ``expr`` wraps onto multiple lines, the baseline of ``Framed[expr]`` is taken to be the baseline of the first line of ``expr``.

* The option setting ``FrameStyle -> None`` draws no explicit frame.

* ``RoundingRadius -> r`` specifies rounded corners consisting of quarter circles with a radius of ``r`` printer's points.

* Frame thickness can be specified using settings such as ``FrameStyle -> Thick``.

---

## Examples (23)

### Basic Examples (1)

Put a frame around any expression:

```wl
In[1]:= Framed[1 / x + y]

Out[1]= (1/x) + y
```

### Scope (7)

Put a frame around any object:

```wl
In[1]:= Framed[Graphics3D[Sphere[], ImageSize -> Tiny]]

Out[1]= [image]

In[2]:= Framed[TabView[{a, b, c}]]

Out[2]= TabView[{{1, 1 -> a}, {2, 2 -> b}, {3, 3 -> c}}, 1]
```

---

Use a background color:

```wl
In[1]:= Framed[1 / x + y + z, Background -> Pink]

Out[1]= (1/x) + y + z
```

---

Use a style for the frame:

```wl
In[1]:= Framed[1 / x + y + z, FrameStyle -> Red]

Out[1]= (1/x) + y + z
```

---

Use rounded corners:

```wl
In[1]:= Framed[1 / x + y + z, RoundingRadius -> 10]

Out[1]= (1/x) + y + z
```

---

Text can linewrap inside a frame:

```wl
In[1]:= Framed[100!]

Out[1]= 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
```

---

```wl
In[1]:= Table[Framed[i!], {i, 10}]

Out[1]= {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800}
```

---

Different framed expressions align as if their frames were not present:

```wl
In[1]:= {Framed[1 / x], Framed[x], Framed[x ^ 2]}

Out[1]= {(1/x), x, x^2}
```

### Options (11)

#### Alignment (1)

Right-align a frame's contents:

```wl
In[1]:= Framed[x + y, ImageSize -> 200, Alignment -> Right]

Out[1]= x + y
```

#### Background (1)

Change the background color:

```wl
In[1]:= Table[Framed[x + y, Background -> c], {c, {LightRed, LightGreen, Yellow}}]

Out[1]= {x + y, x + y, x + y}
```

#### BaselinePosition (1)

Bottom align a series of frames:

```wl
In[1]:= Table[Framed[Style[x + y, n], BaselinePosition -> (Bottom -> Bottom)], {n, {12, 24, 36}}]

Out[1]= {x + y, x + y, x + y}
```

#### BaseStyle (1)

Set the base style for the frame and its contents to a different font size and color:

```wl
In[1]:= Framed[x + y, BaseStyle -> {Red, 24}]

Out[1]= x + y
```

#### ContentPadding (1)

Remove extra whitespace around a label with no ascenders or descenders:

```wl
In[1]:= Framed[xxx, FrameMargins -> 0, ContentPadding -> False]

Out[1]= xxx
```

#### FrameMargins (1)

Add margins within the frame:

```wl
In[1]:= Table[Framed[x + y, FrameMargins -> m], {m, {0, 5, 10, 25}}]

Out[1]= {x + y, x + y, x + y, x + y}
```

#### FrameStyle (2)

Change the frame style:

```wl
In[1]:= Framed[x + y, FrameStyle -> Red]

Out[1]= x + y
```

---

``Framed`` does not support the side specifications of ``FrameStyle`` :

```wl
In[1]:= Framed[x + y, FrameStyle -> {Red, Blue, Green, Brown}]

Out[1]= x + y
```

#### ImageMargins (1)

Add margins outside the frame:

```wl
In[1]:= Table[Framed[x + y, ImageMargins -> m], {m, {0, 5, 10, 25}}]

Out[1]= {x + y, x + y, x + y, x + y}
```

#### ImageSize (1)

Set the frame to a fixed image size:

```wl
In[1]:= Framed[x ^ 2 + 2x y + y ^ 2, ImageSize -> {160, 80}]

Out[1]= x^2 + 2 x y + y^2
```

#### RoundingRadius (1)

Use rounded corners:

```wl
In[1]:= Table[Framed[x + y, RoundingRadius -> m], {m, {0, 5, 10, 25}}]

Out[1]= {x + y, x + y, x + y, x + y}
```

### Applications (1)

Frame integers that are prime:

```wl
In[1]:= Table[If[PrimeQ[n], Framed[n], n], {n, 20}]

Out[1]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
```

### Properties & Relations (2)

``Panel`` provides additional features for framing objects:

```wl
In[1]:= {Panel[1 / x + y], Framed[1 / x + y]}

Out[1]= {(1/x) + y, (1/x) + y}
```

---

Many functions have a ``Frame`` option:

```wl
In[1]:= {Grid[{{1, 2}, {3, 4}}, Frame -> True], Framed[Grid[{{1, 2}, {3, 4}}]]}

Out[1]=
{|   |   |
| - | - |
| 1 | 2 |
| 3 | 4 |, |   |   |
| - | - |
| 1 | 2 |
| 3 | 4 |}

In[2]:= {Plot[Sin[x], {x, 0, 2}, Frame -> True], Framed[Plot[Sin[x], {x, 0, 2}]]}

Out[2]= {[image], [image]}
```

### Neat Examples (1)

```wl
In[1]:= NestList[Framed, x, 6]

Out[1]= {x, x, x, x, x, x, x}
```

## See Also

* [`Labeled`](https://reference.wolfram.com/language/ref/Labeled.en.md)
* [`Frame`](https://reference.wolfram.com/language/ref/Frame.en.md)
* [`Panel`](https://reference.wolfram.com/language/ref/Panel.en.md)
* [`Highlighted`](https://reference.wolfram.com/language/ref/Highlighted.en.md)

## Tech Notes

* [Formatted Output](https://reference.wolfram.com/language/tutorial/TextualInputAndOutput.en.md#6589676)

## Related Guides

* [Viewers and Annotation](https://reference.wolfram.com/language/guide/ViewersAndAnnotation.en.md)
* [Annotating & Combining Graphics](https://reference.wolfram.com/language/guide/AnnotatingAndCombiningGraphics.en.md)
* [Chart Labeling, Legending & Annotation](https://reference.wolfram.com/language/guide/ChartLabelingLegendingAndAnnotation.en.md)
* [Mathematical Typesetting](https://reference.wolfram.com/language/guide/MathematicalTypesetting.en.md)
* [Graphics Annotation & Appearance](https://reference.wolfram.com/language/guide/GraphicsAnnotationAndAppearance.en.md)
* [Notebook Document Generation](https://reference.wolfram.com/language/guide/DocumentGeneration.en.md)

## Related Workflows

* [Put a Frame Around a Cell](https://reference.wolfram.com/language/workflow/PutAFrameAroundACell.en.md)

## Related Links

* [An Elementary Introduction to the Wolfram Language: Ways to Apply Functions](https://www.wolfram.com/language/elementary-introduction/25-ways-to-apply-functions.html)
* [An Elementary Introduction to the Wolfram Language: Pure Anonymous Functions](https://www.wolfram.com/language/elementary-introduction/26-pure-anonymous-functions.html)
* [An Elementary Introduction to the Wolfram Language: Applying Functions Repeatedly](https://www.wolfram.com/language/elementary-introduction/27-applying-functions-repeatedly.html)
* [An Elementary Introduction to the Wolfram Language: More about Pure Functions](https://www.wolfram.com/language/elementary-introduction/29-more-about-pure-functions.html)
* [An Elementary Introduction to the Wolfram Language: Layout and Display](https://www.wolfram.com/language/elementary-introduction/37-layout-and-display.html)

## History

* [Introduced in 2007 (6.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn60.en.md) \| [Updated in 2008 (7.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn70.en.md) ▪ [2010 (8.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn80.en.md) ▪ [2024 (14.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn140.en.md)