Lime Web Components API Documentation - v7.4.0
    Preparing search index...

    Type Alias Location

    Represents a complete location in the application

    A location consists of a path, query parameters, hash fragment, and optional state data. This type is used by Navigator to represent both the current location and navigation targets.

    import { Location, PlatformServiceName } from '@limetech/lime-web-components';

    const target: Location = {
    path: '/products/123',
    query: { tab: 'reviews', sort: 'date' },
    hash: '#review-456',
    state: { fromSearch: true },
    };

    const navigator = platform.get(PlatformServiceName.Navigator);
    navigator.navigate(target);
    type Location = {
        hash: string;
        path: string;
        query: Record<string, unknown>;
        state: unknown;
    }
    Index

    Properties

    Properties

    hash: string

    URL fragment identifier (hash)

    The hash portion of the URL, including the leading # character.

    path: string

    The URL path

    The path portion of the URL, not including query parameters or hash.

    query: Record<string, unknown>

    Parsed URL query parameters

    Query string parameters parsed as an object. Values are automatically parsed using JSON.parse() when possible, allowing for typed values.

    state: unknown

    Navigation state attached to this location

    Custom state data stored with this history entry. State is not visible in the URL and is preserved when navigating back/forward through history.

    Useful for passing context between routes without exposing it in the URL.