Skip to content
ToolShedby Wasim Shaikh
All Angular Material icons

Code Blocks icon

code_blocks: the Code Blocks icon from Material Symbols, in Actions. Customize the size, color, fill and weight below, then copy ready-to-use Angular code.

Style
400
Grade
24px
Size
Colour
Template
<mat-icon>code_blocks</mat-icon>
Component
import { MatIconModule } from '@angular/material/icon';

@Component({
  imports: [MatIconModule],
  // …
})

Code Blocks icon variants

Every Material Symbols style, unfilled and filled, at weights 200, 400 and 700. Copy the <mat-icon> for a style, then set fill and weight with font-variation-settings.

Outlined

material-symbols-outlined
200
400
700
fill 200
fill 400
fill 700
<mat-icon>code_blocks</mat-icon>

Rounded

material-symbols-rounded
200
400
700
fill 200
fill 400
fill 700
<mat-icon fontSet="material-symbols-rounded">code_blocks</mat-icon>

Sharp

material-symbols-sharp
200
400
700
fill 200
fill 400
fill 700
<mat-icon fontSet="material-symbols-sharp">code_blocks</mat-icon>

Examples in Angular Material

Common places to use code_blocks, with the template code. Previews are drawn to match Angular Material's Material 3 components.

Icon button

<button mat-icon-button aria-label="Code Blocks">
  <mat-icon>code_blocks</mat-icon>
</button>

Button with icon

Code Blocks
<button mat-flat-button>
  <mat-icon>code_blocks</mat-icon>
  Code Blocks
</button>

Floating action button

<button mat-fab aria-label="Code Blocks">
  <mat-icon>code_blocks</mat-icon>
</button>

List item

Code Blocks
<mat-list>
  <mat-list-item>
    <mat-icon matListItemIcon>code_blocks</mat-icon>
    <span matListItemTitle>Code Blocks</span>
  </mat-list-item>
</mat-list>

Toolbar

My App
<mat-toolbar>
  <span>My App</span>
  <span class="spacer"></span>
  <button mat-icon-button aria-label="Code Blocks">
    <mat-icon>code_blocks</mat-icon>
  </button>
</mat-toolbar>

Form field prefix

Code Blocks
<mat-form-field appearance="outline">
  <mat-label>Code Blocks</mat-label>
  <mat-icon matPrefix>code_blocks</mat-icon>
  <input matInput />
</mat-form-field>

How to customize the Code Blocks icon in Angular Material

Use the controls at the top of this page to preview code_blocks at any size and color, filled or outlined, and at any weight, grade or optical size, then copy the code. Here is what each setting does in your own Angular app.

Change the Code Blocks icon size

<mat-icon> is fixed at 24 × 24 px, so set width and height along with font-size or the Code Blocks glyph will overflow its box. Match opsz to the size for the crispest strokes.

<mat-icon class="code-blocks-icon">code_blocks</mat-icon>

.code-blocks-icon {
  font-size: 40px;
  width: 40px;
  height: 40px;
  font-variation-settings: 'opsz' 40;
}

Change the Code Blocks icon color

The icon is a font glyph, so it takes the CSS text color. Set color on the <mat-icon> or on a parent, or use a theme variable to follow light and dark mode.

.code-blocks-icon {
  color: #1a73e8;
  /* or follow your Material 3 theme */
  color: var(--mat-sys-primary);
}

Use the filled Code Blocks icon

Material Symbols draws code_blocks as an outline by default. Set the FILL axis to 1 for the solid version. It is the same icon name, so no extra font is needed.

.code-blocks-icon {
  font-variation-settings: 'FILL' 1;
}

Change the Code Blocks icon weight, grade and optical size

Weight (wght, 100 to 700) sets stroke thickness. Grade (GRAD, -25 to 200) fine-tunes thickness without changing size, for example -25 for light icons on dark backgrounds. Optical size (opsz, 20 to 48) adjusts detail for the size you display. Your font link must request these ranges, as below.

<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&icon_names=code_blocks&display=block" />

.code-blocks-icon {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

Code Blocks icon FAQ

How do I change the color of the Code Blocks icon in Angular Material?
Give the <mat-icon> a class and set the CSS color property, for example .code-blocks-icon { color: #1a73e8; }. The code_blocks icon is a font glyph, so any text color works, including theme variables such as var(--mat-sys-primary).
How do I make the Code Blocks icon bigger?
Set font-size, width and height together, for example font-size: 40px; width: 40px; height: 40px;. <mat-icon> has a fixed 24px box, so changing font-size alone makes the icon overflow.
How do I get the filled Code Blocks icon?
Keep <mat-icon>code_blocks</mat-icon> and set font-variation-settings: 'FILL' 1 in CSS. Material Symbols uses one name for both the outlined and filled Code Blocks icon.
How do I make the Code Blocks icon thinner or bolder?
Change the wght axis with font-variation-settings, from 'wght' 100 (thin) to 'wght' 700 (bold). Load the font with the full weight range, or the browser falls back to 400.
Can I download the Code Blocks icon as an SVG?
Yes. Pick a style, fill and weight in the preview above, then open the SVG tab to copy or download code_blocks.svg. Google publishes it under the Apache License 2.0, so it is free for commercial use.

About this icon

Name
code_blocks
Icon set
Material Symbols only (new, not in legacy Material Icons)
Category
Actions
Also found by
algorithm, block, brackets, build, builder, coding, component, connect, construct, css, develop, developer, development, editor, engineer, engineering, flow, function, html, ide, logic, modular, module, platform, programming, script, scripting, sequence, snippet, statement, structure, syntax, visual programming, workflow
Symbols codepoint
U+F84D
Licence
Apache License 2.0, free for commercial use (Google Fonts)

Similar icons