### Store Link App Blocks Reference
Source: https://github.com/vtex-apps/store-link/blob/master/docs/README.md
This section documents the available blocks provided by the 'vtex.store-link' app, detailing their purpose and context requirements. It includes 'link.product' for product-specific links that leverage product context and 'link' for general-purpose links that do not require specific context.
```APIDOC
Block: link.product
Description: A link that uses the product context, such as a product slug or department. For example, /{slug}/p.
Block: link
Description: A regular link that does not require the product context to function. For example, /home.
```
--------------------------------
### Store Link Component Props, Product Variables, and CSS Handles
Source: https://github.com/vtex-apps/store-link/blob/master/docs/README.md
Documents the configurable properties (`variant`, `size`) for the store link component, lists available product variables that can be used to construct dynamic URLs within the `href` prop, and specifies the CSS handles for styling customization.
```APIDOC
Props:
variant:
type: enum
description: Link button that has visual prominence.
possible_values: primary, secondary
default: primary
size:
type: enum
description: Link button size.
possible_values: small, regular, large
default: regular
Product Variables for href:
brand: Product brand name.
brandId: Product brand ID.
category1: Highest level category in the category tree.
category2: Second highest level category.
category3: Third highest level category.
category4: Fourth highest level category.
department: Product department.
productId: Product ID.
skuId: Currently selected SKU ID.
slug: The link text used to create the product link.
CSS Handles:
childrenContainer
label
link
```
--------------------------------
### Configure Product Link with Specification Variables
Source: https://github.com/vtex-apps/store-link/blob/master/docs/README.md
Illustrates how to construct a product link's `href` using product specification variables. This enables dynamic URL generation based on product attributes like design dimensions, allowing for highly specific and structured links.
```json
{
"link.product#vtex": {
"props": {
"href": "{specificationGroups.Design.specifications.Dimensions}",
"label": "VTEX"
}
}
}
```
--------------------------------
### Configure Link with Dynamic Query String
Source: https://github.com/vtex-apps/store-link/blob/master/docs/README.md
Demonstrates how to set up a link's `href` property to dynamically include a query string parameter from the current page context. This allows for flexible URL construction based on existing URL parameters, ensuring the link is built correctly if the parameter is present.
```json
{
"link#foo": {
"props": {
"href": "/login?returnUrl={queryString.returnUrl}",
"label": "Sign in"
}
}
}
```
--------------------------------
### Add Store Link App Dependency to manifest.json
Source: https://github.com/vtex-apps/store-link/blob/master/docs/README.md
This snippet shows how to add the 'vtex.store-link' app as a dependency in your theme's 'manifest.json' file. This is the first step to enable the app's blocks and props, allowing them to be used throughout your store theme.
```diff
"dependencies": {
+ "vtex.store-link": "0.x"
}
```
--------------------------------
### Store Link Block Properties Reference
Source: https://github.com/vtex-apps/store-link/blob/master/docs/README.md
This section provides a detailed reference for all properties applicable to `store-link` blocks. Each property includes its data type, a description of its purpose, and its default value. Special attention is given to `buttonProps`, which is used for styling when `displayMode` is set to `button`, though its nested properties are incompletely documented.
```APIDOC
store-link Block Props:
label:
Type: string
Description: Link text.
Default: undefined
href:
Type: string
Description: Link URL.
Default: #
scrollTo:
Type: string
Description: Element anchor to scroll after navigation. (E.g. "#footer")
Default: undefined
target:
Type: string
Description: Where the linked URL will be displayed. This prop works the same way as the target from [HTML `` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a). Since the [*anchor* element's target](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target) default is `_self`, this prop will be set to `_self` if it is undefined.
Default: undefined
displayMode:
Type: enum
Description: How the link will be displayed. Possible values are: `anchor` (displays a normal link with no styles) or `button` (displays a button that can be customized using the `buttonProps` prop).
Default: anchor
buttonProps:
Type: object
Description: How the link button will be displayed. Use this prop only when the `displayMode` prop is set as `button`.
Default: { variant: primary, size: regular }
Note: The documentation for nested properties of `buttonProps` is incomplete, showing only table headers.
Incomplete Nested Properties Table Headers:
Prop name | Type | Description | Default value
escapeLinkRegex:
Type: string
Description: RegExp, with global match, used to remove special characters within product specifications (e.g., if you want to use `/[%]/g` then `escapeLinkRegex` = `[%]`).
Default: undefined
rel:
Type: string
Description: This prop specifies the relationship between the current document and linked ones for better SEO. This prop works the same way as the `rel` attribute from ``, the [HTML anchor element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a). You can see supported values [here](https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types).
Default: undefined
```
--------------------------------
### Declare Product Link Block in Product Summary Shelf
Source: https://github.com/vtex-apps/store-link/blob/master/docs/README.md
This JSONC snippet demonstrates how to declare a 'link.product' block within a 'product-summary.shelf' block. It configures the link's 'href' using a '{slug}' placeholder and sets its 'label'. This block requires a product context to function correctly, dynamically generating links based on the product data.
```json
{
"link.product#product-page": {
"props": {
"href": "/{slug}/p",
"label": "More details >"
}
},
"product-summary.shelf": {
"children": [
"product-summary-image",
"product-summary-name",
"product-rating-inline",
"product-summary-space",
"product-summary-price",
"link.product#product-page"
]
}
}
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.