We give an axiomatic foundation to $Lambda$-quantiles, a family of generalized quantiles introduced by Frittelli et al. (2014) under the name of Lambda Value at Risk. Under mild assumptions, we show that these functionals are characterized by a property that we call locality, that means that any change in the distribution of the probability mass that arises entirely above or below the value of the $Lambda$-quantile does not modify its value. We compare with a related axiomatization of the usual quantiles given by Chambers (2009), based on the stronger property of ordinal covariance, that means that quantiles are covariant with respect to increasing transformations. Further, we present a systematic treatment of the properties of $Lambda$-quantiles, refining some of the results of Frittelli et al. (2014) and Burzoni et al. (2017) and showing that in the case of a nonincreasing $Lambda$ the properties of $Lambda$-quantiles closely resemble those of the usual quantiles.