---
title: "Code Snippet | No Name Studio"
description: "Importing and displaying source code from your project."
canonical_url: "https://nnsvn.me/vi/products/nuxt-starter-kit/api/advanced/code-snippet"
meta:
  author: "No Name Studio"
  keywords: "No Name Studio, software development, web development, SaaS, digital products, freelance developers, Vietnam"
  "og:description": "Importing and displaying source code from your project."
  "og:image": "https://nnsvn.me/pwa-512x512.png"
  "og:title": "Code Snippet"
  "twitter:description": "Importing and displaying source code from your project."
  "twitter:image": "https://nnsvn.me/pwa-512x512.png"
  "twitter:title": "Code Snippet"
---

> Index of every page on this site: [llms.txt](https://nnsvn.me/llms.txt)

Trang này chưa có bản dịch Tiếng Việt. Bạn đang xem bản gốc (English).

# **Code Snippet**

## Usage

#### Add the `CodeSnippet` component

#### Add paths you want to import

Use the [**Glob Import pattern**](https://vite.dev/guide/features#multiple-patterns) to add paths.

****DO NOT**** import files like `.env` or files from your `server/` directory.

The `/nuxt.config.ts` file can not be imported due to framework constraints

#### Use in markdown files

### Highlighting Lines

Translates to:

### Using Offset Props

### Fetching From a Remote URL

## Props

**file**string

The path to the imported file

**url**string

A remote URL to fetch the code from

**title**string

Code block title

**language**string

Code block highlight language

**highlights**string

Code block highlights lines

**meta**string

Code block meta

**start**number

Starting line index

**offset**number

Number of lines to display from start

[Phản ánh vấn đề](https://github.com/No-Name-Studio-VN/Homepage/issues/new/choose)· [Chỉnh sửa trang này](https://github.com/No-Name-Studio-VN/Homepage/edit/main/content/1.products/1.nuxt-starter-kit/3.api/3.advanced/3.code-snippet.md)

```json
{"@context":"https://schema.org","@type":"Article","headline":"Code Snippet","description":"Importing and displaying source code from your project.","url":"https://nnsvn.me/vi/products/nuxt-starter-kit/api/advanced/code-snippet","mainEntityOfPage":{"@type":"WebPage","@id":"https://nnsvn.me/vi/products/nuxt-starter-kit/api/advanced/code-snippet"},"publisher":{"@type":"Organization","name":"No Name Studio"}}
```

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Products","item":"https://nnsvn.me/vi/products/nuxt-starter-kit/getting-started/introduction"},{"@type":"ListItem","position":2,"name":"Nuxt Starter Kit","item":"https://nnsvn.me/vi/products/nuxt-starter-kit/getting-started/introduction"},{"@type":"ListItem","position":3,"name":"Api","item":"https://nnsvn.me/vi/products/nuxt-starter-kit/api/configuration/shadcn-docs"},{"@type":"ListItem","position":4,"name":"Advanced","item":"https://nnsvn.me/vi/products/nuxt-starter-kit/api/advanced/override"},{"@type":"ListItem","position":5,"name":"Code Snippet","item":"https://nnsvn.me/vi/products/nuxt-starter-kit/api/advanced/code-snippet"}]}
```

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://nnsvn.me/vi#website","@type":"WebSite","description":"No Name Studio is a freelance software team building production-grade web applications, SaaS platforms, and digital products for startups and enterprises.","inLanguage":"vi","name":"No Name Studio","url":"https://nnsvn.me/vi","publisher":{"@id":"https://nnsvn.me/#identity"},"translationOfWork":{"@id":"https://nnsvn.me/#website"}},{"@id":"https://nnsvn.me/vi/products/nuxt-starter-kit/api/advanced/code-snippet#webpage","@type":"WebPage","description":"Importing and displaying source code from your project.","name":"Code Snippet","url":"https://nnsvn.me/vi/products/nuxt-starter-kit/api/advanced/code-snippet","isPartOf":{"@id":"https://nnsvn.me/vi#website"},"potentialAction":[{"@type":"ReadAction","target":["https://nnsvn.me/vi/products/nuxt-starter-kit/api/advanced/code-snippet"]}]},{"@id":"https://nnsvn.me/#identity","@type":"Organization","name":"No Name Studio","url":"https://nnsvn.me"}]}
```

## Sitemap

See the full [sitemap](https://nnsvn.me/sitemap.md) for all pages.
