The barnnamn package is a Swedish equivalent to the babynames package. Anything you do with babynames you should be able to do with barnnamn instead. Loading the barnnamn library provides a single tibble, also called barnnamn, which shares the same structure as the babynames tibble from babynames.
The Swedish names data comes from the Statistiska centralbyrån (Central Statistical Bureau), which provides data from 1998 to 2022. In 2024 they stopped publishing this data, which means that data from 2023 onwards will be unavailable.